<table>
    <thead>
        <tr>
        	<g:if test="${sort}">
	            <g:sortableColumn property="username" title="${message(code: 'shiro.user.username.label', default: 'Username')}" />
	            <g:sortableColumn property="profile" title="${message(code: 'shiro.user.profile.label', default: 'Profile')}" />
	            <g:sortableColumn property="department" title="${message(code: 'shiro.user.department.label', default: 'Department')}" />
	            <g:sortableColumn property="group" title="${message(code: 'shiro.user.group.label', default: 'Group')}" />
	       	    <g:sortableColumn property="dateCreated" title="Date Created" titleKey="shiro.user.dateCreated" />
	       	    <g:sortableColumn property="lastUpdated" title="Last Updated" titleKey="shiro.user.lastUpdated" />
        	</g:if>
			<g:else>
	            <th><g:message code="shiro.user.username.label" default="Username" /></th>
	            <th><g:message code="shiro.user.profle.label" default="Profile" /></th>
	            <th><g:message code="shiro.user.department.label" default="Department" /></th>
	            <th><g:message code="shiro.user.group.label" default="Group" /></th>
	       	    <th><g:message code="shiro.user.dateCreated" default="Date Created" /></th>
	       	    <th><g:message code="shiro.user.lastUpdated" default="Last Updated" /></th>
			</g:else>        	
        </tr>
    </thead>
    <tbody>
    <g:each in="${userInstanceList}" status="i" var="userInstance">
        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
            <td><g:link controller="user" action="show" id="${userInstance.id}">${fieldValue(bean: userInstance, field: "username")}</g:link></td>
            <td>${fieldValue(bean: userInstance, field: "profile")}</td>
            <td>${fieldValue(bean: userInstance, field: "department")}</td>
            <td>${fieldValue(bean: userInstance, field: "group")}</td>
            <td><g:formatDate date="${userInstance.dateCreated}" /></td>
            <td><g:formatDate date="${userInstance.lastUpdated}" /></td>
        </tr>
    </g:each>
    </tbody>
</table>
